package recursion;

import java.util.Scanner;

public class HanoiTower {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        System.out.println(process('a', 'c', n));

    }
    public static String process(char start, char end, int num) {
        String str = "";
        if (num == 1) {
            str += start + " --> " + end + "\n";
        } else if (num > 1) {
            char temp = 'x';
            if (start == 'a' && end == 'b' || start == 'b' && end == 'a') {
                temp = 'c';
            } else if (start == 'b' && end == 'c' || start == 'c' && end == 'b') {
                temp = 'a';
            } else if (start == 'a' && end == 'c' || start == 'c' && start == 'a') {
                temp = 'b';
            }
            str += process(start, temp, num-1);
            str += start + " --> " + end + "\n";
            str += process(temp, end, num-1);
        }
        return str;
    }
}
